/******************* 公共变量 *******************/
var userId = core.getUrlData('user_id'),
	userName = core.getUrlData('user_name');

/******************* Vue初始化 *******************/
var vm = new Vue({
	el: '.wrap',
	data: {
		userId: userId,
		user_blacklist: userBlacklistUrl + '?user_id=' + userId,
		user_feedback: userFeedbackUrl + '?user_id=' + userId,
		user_about: userAboutUrl + '?user_id=' + userId,
		exception: false,
		contact: 0,
		message: 0
	},
	methods: {
		switchBtn: function (prop) {
			var _this = this;
			// if ((prop == 'contact') && (_this.contact == 1)) {
			// 	core.layerHint('系统将自动过滤您手机通讯录的好友（除例外名单以外）');
			// 	_this.exception = true;
			// } else {
			// 	_this.exception = false;
			// }
			if (prop == 'message') {
				$.ajax({
					url: changeNews,
					type: 'post',
					success: function(data) {
						console.log(data);

						(data.result == 1) && ((_this.message == 1) ? (_this.message = 0) : (_this.message = 1));
					}
				});
			}
		},
		logout: function () {
			var _this = this;

			common.layerConfirm({
				content: '确定退出登录？',
				yesClose: false,
				yes: function() {
					core.href(logoutUrl);
				}
			});
		}
	},
	computed: {
		
	},
	components: {
		
	},
	created: function () {
		var _this = this;
		$.ajax({
			url: checkNews,
			type: 'post',
			success: function(data) {
				console.log(data)

				_this.message = data.id;
			}
		});
	},
	mounted: function () {
		common.bindBack();
	}
});

